You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): Servers panel no longer lists the Claude CLI's own port - #36176
Every Claude thread lists the Claude CLI itself under Servers (localhost:<port> · Agent · 2.1.323), and the page returns 404. Claude Code holds a loopback port once a plugin registers a tool with $.tool.register. The CLI carries T3CODE_THREAD_ID, so the scanner reads that port as a server the thread started. Details and repro: #36173.
Change
ClaudeAdapterV2 spawnClaudeCodeProcess
- portDiscovery.trackAgent()+ portDiscovery.trackAgent(child.pid)
PortScanner withAgentOwners
- owners.set(pid, agent) // every pid with the thread+ if (!agentCliPids.has(pid)) owners.set(pid, agent)
Only the CLI's own pid is skipped. Servers it starts keep their attribution. Codex and ACP calls are unchanged: the Codex CLI does not carry the thread, and ACP adapters do not call trackAgent.
Door: two-way. Blast Radius: narrow. A wrong pid would hide one row in the Servers panel.
The Claude CLI runs with its thread id in its environment, so port
discovery attributed a port the CLI holds itself to the thread and
listed it as a server. Claude Code holds one whenever a plugin
registers a tool with $.tool.register. The adapter now passes the
CLI's pid to trackAgent, and the scanner skips that pid's listeners.
Servers the CLI starts are still listed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Macroscope's review found this PR approvable — The Servers panel excludes the Claude CLI’s own listener while retaining servers it starts. The change is confined to discovery attribution, with no persistent-data or process-control changes.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 6e16b77 and d954f87.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Port discovery now tracks active agent CLI PIDs and excludes those processes from agent server ownership. The Claude adapter passes the spawned child PID to port discovery. A test checks that the CLI listener is excluded while a child server listener remains discoverable.
Port discovery does not assign agent ownership to active CLI PIDs. The Claude adapter supplies the child PID, and a test checks that scanning excludes the CLI listener but reports the child server listener.
The Servers panel stops listing the Claude CLI's own port while still showing servers the agent starts. The change is narrow and cosmetic in scope. No concrete defect was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the Servers panel no longer lists the Claude CLI's own port. It matches the diff, which skips the CLI pid in agent-owner resolution and passes the pid through trackAge…
Description check
The description follows the template. It covers Problem, Change, Scope, and Verification. The Problem section gives the symptom, the trigger, and a link to the issue. The Change section shows the diff…
Linked Issues check
Issue #36173 requires the Servers section to list only servers started by the thread's agent or terminals. It must not list the Claude CLI's own loopback port. At the reviewed head, PortScanner.ts a…
Out of Scope Changes check
The whole-PR changes are limited to the Claude adapter PID handoff, the PortScanner.ts CLI-PID set and owner-attribution skip, and a new test case. The cliPid parameter is optional, so Codex and A…
Full details: Title check
Explanation
The title names the main change: the Servers panel no longer lists the Claude CLI's own port. It matches the diff, which skips the CLI pid in agent-owner resolution and passes the pid through trackAgent. The title follows the conventional commit form the repository template asks for.
Full details: Description check
Explanation
The description follows the template. It covers Problem, Change, Scope, and Verification. The Problem section gives the symptom, the trigger, and a link to the issue. The Change section shows the diff and says what is unchanged for Codex and ACP. Scope links #36173. Verification lists a focused test on Linux and macOS, a manual run with screenshots, and states what was not checked (Linux and Windows runs). The model and harness line is present. The Verification section does not state the exact test command result for Linux and macOS separately, and the 'Created with Claude Opus 5.5' line is an unverified model claim, but these do not leave the description largely incomplete.
Full details: Linked Issues check
Explanation
Issue #36173 requires the Servers section to list only servers started by the thread's agent or terminals. It must not list the Claude CLI's own loopback port. At the reviewed head, PortScanner.ts adds an optional cliPid to trackAgent and stores it in agentCliPids. withAgentOwners now skips any PID in that set, so the CLI listener is not attributed to the thread. Other PIDs that carry T3CODE_THREAD_ID keep their attribution, so servers the agent starts stay listed. trackAgent's release function deletes the PID, so a reused PID is not skipped later. The whole-PR diff from the merge base confirms this logic. Per the summary, ClaudeAdapterV2.ts passes child.pid to trackAgent. The summary also reports a Linux/macOS test in PortScanner.test.ts. I did not inspect that test file or the adapter hunk directly in this review. Remaining uncertainty: the fix assumes the listening socket belongs to the process whose PID is child.pid. If Claude Code binds the port in a helper process, that listener stays attributed. The PR reports that the CLI holds the port directly. Manual macOS verification is non-coding and does not affect this result.
Full details: Out of Scope Changes check
Explanation
The whole-PR changes are limited to the Claude adapter PID handoff, the PortScanner.ts CLI-PID set and owner-attribution skip, and a new test case. The cliPid parameter is optional, so Codex and ACP callers that omit it keep prior behavior. The trackAgent doc comment and signature change directly support the new parameter. No unrelated hunks appear in the inspected PortScanner.ts diff. The adapter and test hunks rely on the PR summary, which describes them as directly tied to the same fix.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The automated pipeline stopped on this pull request and will not merge it:
the fix is written and reviewed, but proving it needs something no worker has:
Permanent blocker: The supplied reproduction requires macOS with Claude Code 2.1.323 and a plugin whose session.start hook registers a ping tool through $.tool.register. This VM is Linux, and access to another macOS host outside the device pool is prohibited. Replay scenarios cannot reproduce provider-specific behavior.
The CLI listener disappearing and an agent-started Python HTTP server remaining visible with agent attribution were not verified on either commit.
Thanks for the PR, @sulcer! #38916 already fixes this on main, so we're closing this PR. If you think the problem still exists, let us know and we can reopen it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needs-rebaseConflicts with its base branch. Closes after 7 days with no activity.size:S10-29 changed lines (additions + deletions).takeover:blockedTakeover blocked; reason in the PR bodyvouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every Claude thread lists the Claude CLI itself under Servers (
localhost:<port> · Agent · 2.1.323), and the page returns 404. Claude Code holds a loopback port once a plugin registers a tool with$.tool.register. The CLI carriesT3CODE_THREAD_ID, so the scanner reads that port as a server the thread started. Details and repro: #36173.Change
Only the CLI's own pid is skipped. Servers it starts keep their attribution. Codex and ACP calls are unchanged: the Codex CLI does not carry the thread, and ACP adapters do not call
trackAgent.Door: two-way. Blast Radius: narrow. A wrong pid would hide one row in the Servers panel.
Scope
Fixes #36173.
Verification
PortScanner.test.ts(Linux and macOS): fails onmainwith the CLI's listener listed, passes here.vp run check:changedpasses.vp run devwith a real Claude thread and a mod that registers a tool. The CLI holds a port in both runs.mainpython3 -m http.serverI did not run it on Linux or Windows. Windows does not attribute agent listeners at all.
Created with Claude Opus 5.5 in Claude Code.